<template>
  <div>
    <el-form v-model="lineTypeForm" label-width="140px">
      <el-form-item label="线路类型编号">
        <el-input v-model="lineTypeForm.typeNumber" placeholder="请输入线路类型编号"/>
      </el-form-item>

      <el-form-item label="线路类型名称">
        <el-input v-model="lineTypeForm.name" placeholder="请输入线路类型名称"/>
      </el-form-item>
      <el-form-item label="起始机构类型">
        <el-select v-model="lineTypeForm.startAgencyType" disabled>
          <el-option label="网点" :value="1"/>
        </el-select>
      </el-form-item>

      <el-form-item label="终点机构类型">
        <el-select v-model="lineTypeForm.endAgencyType" disabled>
          <el-option label="网点" :value="1"/>
        </el-select>
      </el-form-item>

      <el-form-item label="状态">
        <el-radio v-model="lineTypeForm.status" :label="1" border>正常</el-radio>
        <el-radio v-model="lineTypeForm.status" :label="0" border>禁用</el-radio>
      </el-form-item>
    </el-form>
    <el-button type="primary" @click="addTransportLineType">添加</el-button>
  </div>
</template>

<script>
import transportLineType from '@/api/base/transportLineType/index'

export default {
  name: 'add',
  data() {
    return {
      lineTypeForm: {
        name: '',
        typeNumber: '',
        startAgencyType: 1,
        endAgencyType: 1,
        status: 1,
        updater: 1
      }
    }
  }, methods: {
    addTransportLineType() {
      transportLineType.addTransportLineType(this.lineTypeForm).then(data => {
        this.$message({
          type: 'success',
          message: '添加线路类型成功!',
          showClose: true
        })
        this.$router.push({ path: '/transport-type-index' })
      })
    }
  }, mounted() {

  }
}
</script>

<style scoped>

</style>
